function add1() {
    var input1 = document.createElement('input');
    input1.setAttribute('type', 'text');
    input1.setAttribute('name', 'organizers[]');
    input1.setAttribute('id', 'Add-Content');

    var btn1 = document.getElementById("org");
    btn1.insertBefore(input1, null);
}


function changeState(id) {
    $.ajax({
        url: "/Home/ChangeState",
        data: {id:id},
        type: "GET",
        
        success: function (data) {
            $("#form").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}

function changeStateInMatter(id) {
    $.ajax({
        url: "/Matter/GetAllMatter",
        data: { id: id },
        type: "GET",

        success: function (data) {
            $("#showMatters").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}
function changeActivityState(id) {
    $.ajax({
        url: "/Home/ChangeActivityState",
        data: { id: id },
        type: "GET",

        success: function (data) {
            $("#activity").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}

window.onload = function () {
        $.ajax({
            url: "/Home/MyActivity",
            type: "GET",
            
            success: function (data) {
                $("#activity").html(data);
                $("#load").css("display", "none");
            },
            beforeSend: function () {
                $("#load").css("display", "block");
            },
            error: function (err) {
                alert("请求失败");
                $("#load").css("display", "none");
            }
        })
}

function details(id) {
    $.ajax({
        url: "/Home/ShowMatter",
        data: { id: id },
        type: "GET",

        success: function (data) {
            $("#details").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}


function Delete(id) {
    $.ajax({
        url: "/Home/DeleteMatter",
        data: { id: id },
        type: "GET",

        success: function (data) {
            $("#form").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}

function DeleteActivityMatter(id) {
    $.ajax({
        url: "/Home/DeleteActivityMatter",
        data: { id: id },
        type: "GET",

        success: function (data) {
            $("#activity").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}

function DeleteMatterInMatter(id) {
    $.ajax({
        url: "/Matter/DeleteMatter",
        data: { id: id },
        type: "GET",

        success: function (data) {
            $("#showMatters").html(data);
        },
        error: function (err) {
            alert("请求失败");
        }
    })
}